package sudroid.android;

import android.os.Looper;
import android.os.Process;

public class HandlerThread extends Thread
{
  private Looper mLooper;
  private int mPriority;
  private int mTid = -1;

  public HandlerThread(String paramString)
  {
    super(paramString);
    this.mPriority = 0;
  }

  public HandlerThread(String paramString, int paramInt)
  {
    super(paramString);
    this.mPriority = paramInt;
  }

  public Looper getLooper()
  {
    Looper localLooper;
    if (!isAlive())
      localLooper = null;
    while (true)
    {
      return localLooper;
      monitorenter;
      try
      {
        while (true)
        {
          if ((!isAlive()) || (this.mLooper != null))
          {
            monitorexit;
            localLooper = this.mLooper;
            break;
          }
          try
          {
            wait();
          }
          catch (InterruptedException localInterruptedException)
          {
          }
        }
      }
      finally
      {
        monitorexit;
      }
    }
    throw localObject;
  }

  public int getThreadId()
  {
    return this.mTid;
  }

  protected void onLooperPrepared()
  {
  }

  public boolean quit()
  {
    Looper localLooper = getLooper();
    if (localLooper != null)
      localLooper.quit();
    for (int i = 1; ; i = 0)
      return i;
  }

  public void run()
  {
    int i = Process.myTid();
    this.mTid = i;
    Looper.prepare();
    monitorenter;
    try
    {
      Looper localLooper = Looper.myLooper();
      this.mLooper = localLooper;
      notifyAll();
      monitorexit;
      Process.setThreadPriority(this.mPriority);
      onLooperPrepared();
      Looper.loop();
      this.mTid = -1;
      return;
    }
    finally
    {
      monitorexit;
    }
    throw localObject;
  }
}

/* Location:           D:\Program Files\eclipse\apktool-r01-3\新浪微博\classes.dex.dex2jar.jar
 * Qualified Name:     sudroid.android.HandlerThread
 * JD-Core Version:    0.6.0
 */